package com.pms.utils;

import java.util.ArrayList;
import java.util.List;

import com.pms.domain.AuthticateResEntity;
import com.pms.domain.RError;
import com.pms.domain.Response;
import com.pms.domain.ResponseHeader;
import com.pms.domain.ReturnResult;

public class CreateResponse {
	
	public static Object createReponse(int status,AuthticateResEntity authticateResEntity) {
		Response<AuthticateResEntity> response = new Response<AuthticateResEntity>();
		ReturnResult<AuthticateResEntity> returnResult = new ReturnResult<AuthticateResEntity>();
		RError error = new RError();
		error.setInfo(authticateResEntity.getStatusDesc());
		List<AuthticateResEntity> list = new ArrayList<AuthticateResEntity>();
		list.add(authticateResEntity);
		returnResult.setMylist(list);
		returnResult.setNumFound(list.size());
		ResponseHeader responseHeader = new ResponseHeader();
		responseHeader.setStatus(status);
		responseHeader.setError(error);
		response.setResponseHeader(responseHeader);
		response.setResult(returnResult);
		return response;
	}
}
